﻿@*@model IEnumerable<CarparkIMS_Model.llqqPlateLog>*@
@model IEnumerable<llqqPlateLogViewModel>

@{
    ViewData["Title"] = "認車牌記錄";

    DateTime date = ViewBag.date ?? DateTime.Now;
    DateTime minDate = ViewBag.minDate ?? DateTime.Now.AddMonths(-3);
    DateTime maxDate = ViewBag.maxDate ?? DateTime.Now;
}

<h1>認車牌記錄</h1>

<form asp-controller="Journal" asp-action="Index" method="get">
    <p>
        搜尋: <input type="text" name="SearchString" />
        <input type="date" id="date" name="date" value="@date.ToString("yyyy-MM-dd")" min="@minDate.ToString("yyyy-MM-dd")" max="@maxDate.ToString("yyyy-MM-dd")">
        <input type="submit" value="篩選" />
    </p>
</form>
<table class="table">
    <thead class="bg">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.date)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.plate)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.isValid)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ip)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.image64)
            </th>
            @*<th></th>*@
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @item.date
                </td>
                <td>
                    @item.plate
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.isValidPlate)
                </td>
                <td>
                    @item.ip/@item.ParkingPlaceId
                </td>
                <td>
                    <img src="@Url.Action("GetImage","PlateRecognize",new {Id=item.ID })" class="img-carplate" style="display:inline-block;" onerror="this.width=this.height" />
                </td>

            </tr>
        }
    </tbody>
</table>
